package com.tencet.service.Impl;

import com.tencet.dao.RechargeDAO;
import com.tencet.dao.impl.AccountOneDAOImpl;
import com.tencet.dao.impl.AccountTwoDAOImpl;
import com.tencet.dao.impl.RechargeDAOImpl;
import com.tencet.entity.AccountOne;
import com.tencet.entity.AccountTwo;
import com.tencet.entity.Recharge;
import com.tencet.service.RechargeService;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: stand    @date: 2022/7/20 15:06
 * @description:
 */
public class ReChargeServiceImpl implements RechargeService {
    private  RechargeDAO rechargeDAO = new RechargeDAOImpl();
    private AccountTwoServiceImpl accountTwoService = new AccountTwoServiceImpl();
    @Override
    public int addBean(Recharge recharge) {
        return rechargeDAO.insert(recharge);
    }

    @Override
    public int addBalance(int sum, String card_num2) {
        return accountTwoService.addBalance(sum,card_num2);
    }


    @Override
    public List<Recharge> rechargeShow(String bank_account) {
        List<Recharge> rechargeshow = rechargeDAO.rechargeshow(bank_account);
        if (rechargeshow != null) {
            return rechargeshow;
        }else {
            return null;
        }

    }
}